package com.itheima.d04_xml_write;



public class Test {
    public static void main(String[] args) {
        //1.拼接xml格式的字符串：StringBuilder效率高/StringBuffer 效率低
        StringBuilder sb = new StringBuilder();
        sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n")
                .append("<users id = '1001'>\r\n")

                .append("\t<user>\r\n")
                  .append("\t\t<name id = '1' num = '1'>张三</name>\r\n")
                  .append("\t\t<age>18</age>\r\n")
                  .append("\t\t<sex>男</sex>\r\n")
                .append("\t<user>\r\n");


        //2.通过IO流写入xml文件


    }
}
